% Purpose: Run texture features from Veggie Vision
% Date: 11/18/2012
% Author: R. Dutka
%Get Input
function [outputA, outputB] = Texture_Features(mask, rgbImage, flagNorm)
global numBins;
[rows columns] = size(mask);

% Split into color bands.
%redBand = rgbImage(:,:, 1);
greenBand = rgbImage(:,:, 2);
%blueBand = rgbImage(:,:, 3);

outputA = Run_MeasurementA(mask, greenBand);
%magnitude histogram
maxM = 1400;
incM = maxM/numBins;
outputA = histc(outputA, incM/2:incM:maxM-incM/2);
if flagNorm
    outputA = outputA./sum(outputA);
end
outputA = outputA.';


outputB = Run_MeasurementB(mask, greenBand);
%magnitude histogram
maxI = 160;
incI = maxI/numBins;
outputB = histc(outputB, incI/2:incI:maxI-incI/2);
if flagNorm
    outputB = outputB./sum(outputB);
end
outputB = outputB.';